<?php
$this->breadcrumbs = array(
	'员工列表',
);

$this->userActions = array(
	array(
		'label' => '新建员工',
		'url' => array(
			'create'
		),
		'visible' => Yii::app()->user->checkAccess('employeeAdmin'),
	),
	array(
		'label' => '管理员工',
		'url' => array(
			'admin'
		),
		'visible' => Yii::app()->user->checkAccess('employeeAdmin'),
	),
);
?>

<h1>员工列表</h1>
<div class="form">
<?php $form = $this
	->beginWidget('CActiveForm',
		array(
			'action' => Yii::app()->createUrl($this->route),
			'method' => 'get',
		));
?>

	<?php echo $form->errorSummary($searchModel); ?>
<fieldset>
<legend>搜索条件</legend>

	<div class="span-6">
		<?php echo $form->labelEx($searchModel, 'name'); ?>
		<?php echo $form->textField($searchModel, 'name', array(
				'size' => 6
			));
		?>
	</div>
	<div class="span-5">
		<?php echo $form->labelEx($searchModel, 'employed'); ?>
		<?php echo $form
			->dropDownList($searchModel, 'employed', JHTML::getBooleanValues(),
				array(
					'empty' => '全部',
				));
		?>
	</div>
	<div class="span-5">
		<?php echo $form->labelEx($searchModel, 'status'); ?>
		<?php echo $form
			->dropDownList($searchModel, 'status', Employee::getAllStatus(),
				array(
					'empty' => '全部',
				));
		?>
	</div>
	<div class="clear"></div>
	<div class="span-11">
		<?php echo $form->labelEx($searchModel, 'employedDateStart'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $searchModel,
					'attribute' => 'employedDateStart',
				));
		?> - 
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $searchModel,
					'attribute' => 'employedDateEnd',
				));
		?>
	</div>
	<div class="span-11">
		<?php echo $form->labelEx($searchModel, 'projectId'); ?>
		<?php $this
			->widget('widgets.project.JProjectSelector',
				array(
					'model' => $searchModel,
					'attribute' => 'projectId',
				));
		?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('搜索'); ?>
	</div>

</fieldset>
<?php $this->endWidget(); ?>
</div>
<div class="employee-list">
<?php $this
	->widget('zii.widgets.CListView',
		array(
			'dataProvider' => $dataProvider,
			'itemView' => '_view',
			'viewData' => array(
				'booleans' => JHTML::getBooleanValues(),
			),
			'separator' => '<div class="list-item-separator"></div>',
		));
?>
</div>
